To include sequence numbers in document names, a document naming function must be created in VBScript that can be called from remote vaults when new documents are created. This function must receive all the information it needs to know about the new documents as parameters.
Note The Document object cannot be used in this function because the document being created could be in a remote vault and will not be available as the selected document in the vault where the name is generated.
The following function implements the naming scheme described in Centralizing sequence number generation:
Function NextDocumentName (DocType)
Select Case DocType
Case "Generic Document"
NextDocumentName = "GEN-" & Right ("00000" & Vault.Sequence ("Generic").Next, 5)
Case Else
NextDocumentName = "OTH-" & Right ("00000" & Vault.Sequence ("Other").Next, 5)
End Select
End Function
This function accepts the display name of a document type as a parameter, generates the document name, and returns it to the caller.
This function needs to be implemented only in the hub vault where the number sequences will be centralized. The function is called from the remote vaults as described in Requesting a document name.
For information on modifying this procedure for when the hub vault is not available, see Handling hub vault unavailability.
Related concepts
Centralizing sequence number generation
Understanding table data replication
Related tasks
Transferring ownership upon release
Calculating import notification messages
Executing remote script functions
Handling hub vault unavailability